Relay e2e tests #757
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Relay e2e tests | |
on: | |
schedule: | |
- cron: 0 8 * * * | |
workflow_call: | |
inputs: | |
environment: | |
required: true | |
default: stage | |
type: string | |
health_check: | |
required: false | |
default: false | |
type: boolean | |
secrets: | |
E2E_TEST_ACCOUNT_FREE: | |
required: true | |
E2E_TEST_ACCOUNT_PASSWORD: | |
required: true | |
E2E_TEST_ACCOUNT_PREMIUM: | |
required: true | |
E2E_TEST_BASE_URL: | |
required: true | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: Environment to run the e2e against | |
required: true | |
default: stage | |
type: choice | |
options: | |
- stage | |
- prod | |
- dev | |
health_check: | |
description: Enable health check | |
required: false | |
default: false | |
type: boolean | |
jobs: | |
relaye2e: | |
name: ${{ inputs.health_check && 'Relay e2e health check' || 'Relay e2e all tests' }} | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4.0.2 | |
with: | |
node-version-file: frontend/package.json | |
cache: npm | |
- name: Install Node dependencies | |
run: npm install | |
- name: Install Playwright Browsers | |
run: | | |
npm install -D @playwright/test --with-deps | |
npx playwright install | |
- name: Run Playwright tests | |
run: > | |
commandenv="${{ inputs.environment != null && inputs.environment || 'stage' | |
}}" | |
if ${{ contains(inputs.health_check, 'true') }}; then | |
E2E_TEST_ENV=$commandenv npx playwright test --grep "@health_check" | |
else | |
npm run test:$commandenv | |
fi | |
env: | |
E2E_TEST_ENV: ${{ inputs.environment != null && inputs.environment || 'stage' }} | |
E2E_TEST_ACCOUNT_FREE: ${{ secrets.E2E_TEST_ACCOUNT_FREE }} | |
E2E_TEST_ACCOUNT_PASSWORD: ${{ secrets.E2E_TEST_ACCOUNT_PASSWORD }} | |
E2E_TEST_ACCOUNT_PREMIUM: ${{ secrets.E2E_TEST_ACCOUNT_PREMIUM }} | |
E2E_TEST_BASE_URL: ${{ secrets.E2E_TEST_BASE_URL }} | |
- name: Upload html report as artifact to troubleshoot failures. | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 5 |